﻿using System;

namespace CompositeDesignPattern
{
    public class DocumentParagraph : DocumentElement
    {
        private String text = String.Empty;

        public DocumentParagraph(String text)
        {
            this.text = text;
        }

        public override void Write()
        {
            Console.WriteLine("{0}{1}", @"  ", this.text);
        }

        public override void Add(DocumentElement child)
        {
            throw new NotSupportedException();
        }

        public override void Remove(DocumentElement child)
        {
            throw new NotSupportedException();
        }
    }
}
